﻿#include "MoreInfoDialog.h"

MoreInfoDialog::MoreInfoDialog(QWidget *parent)
	: QDialog(parent)
	, ui(new Ui::MoreInfoDialogClass())
{
	ui->setupUi(this);

}

MoreInfoDialog::~MoreInfoDialog()
{
	delete ui;
}

void MoreInfoDialog::setAfe(uint afe[30])
{
	for (int i = 0;i<30;i++)
	{
		m_afeVec.append(afe[i]);
	}
}

void MoreInfoDialog::setAfeTemp(uint afeTemp[30])
{
	for (int i = 0; i < 30; i++)
	{
		m_afeTempVec.append(afeTemp[i]);
	}
}

void MoreInfoDialog::showMoreInfo()
{
	for (int i = 0;i<30;i++)
	{
		m_vItemVec[i]->setText(QString::number(m_afeVec[i]));
		m_tItemVec[i]->setText(QString::number(m_afeTempVec[i]));
	}
}

void MoreInfoDialog::init()
{
	ui->tableWidget->setRowCount(300);
	ui->tableWidget->verticalHeader()->hide();
	for (int i = 0; i < 30; i++)
	{
		QTableWidgetItem *item = new QTableWidgetItem(QString::number(i + 1));
		ui->tableWidget->setItem(i, 0, item);
		m_numItemVec.append(item);
		for (int j = 1; j < 3; j++) {
			QTableWidgetItem *item2 = new QTableWidgetItem();
			ui->tableWidget->setItem(i, j, item2);
			if (j == 1)
			{
				m_vItemVec.append(item2);
			}
			else
			{
				m_tItemVec.append(item2);
			}
		}
	}
}
